from flask_wtf import Form
from wtforms import StringField, TextAreaField,DateTimeField, BooleanField, SelectField,SubmitField
from wtforms.validators import Required, Length, Email, Regexp

class NameForm(Form):
    name = StringField('What is your name?', validators=[Required()])
    submit = SubmitField('Submit')

class NewsForm(Form):
    title = StringField('新闻标题',validators=[Required()])
    imgUrl = StringField('图片链接(如果没有，可不填)')
    digest = TextAreaField('新闻摘要',validators=[Required()])
    content = TextAreaField('新闻内容',validators=[Required()])
    type = StringField('新闻类型',validators=[Required()])
    pubTime = DateTimeField('发布时间(格式为: yyyy-mm-dd HH:MM:SS)',format='%Y-%m-%d %H:%M:%S',validators=[Required()])
    publisher = StringField('发布者',validators=[Required()])
    submit = SubmitField('提交')
